home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_445 / turbotext / rexx / printblk.ttx < prev    next >
Text File  |  1992-05-06  |  972b  |  52 lines

  1.  
  2. /** $VER: PrintBlk.ttx Demo 1.0 (9.12.90)
  3.  **
  4.  ** Print the currently selected block.
  5.  **
  6.  ** Written by Martin Taillefer
  7.  **/
  8.  
  9.  
  10. OPTIONS RESULTS
  11. OPTIONS FAILAT 21
  12.  
  13.  
  14.   GetCursorPos
  15.   PARSE VAR RESULT cursorLine cursorColumn .
  16.  
  17.   GetBlkInfo
  18.   PARSE VAR RESULT blockActive verticalBlock blockLine blockColumn .
  19.  
  20.   IF blockActive = "ON" THEN DO
  21.     SetDisplayLock ON
  22.  
  23.     /* save current contents of clipboard to the end of the file */
  24.     SetBookmark 0
  25.     MoveEOF
  26.     SetBookmark 191    /* pick a number, any number... */
  27.     PasteClip
  28.     MoveBookmark 0
  29.  
  30.     /* print the current block */
  31.     CopyBlk
  32.     PrintClip
  33.  
  34.     /* restore the previous contents of the clipboard */
  35.     MoveBookmark 191
  36.     ClearBookmark 191
  37.     MarkBlk
  38.     MoveEOF
  39.     CutBlk
  40.  
  41.     /* remark the selected block */
  42.     Move blockLine blockColumn
  43.     IF verticalBlock = "ON" THEN
  44.       MarkBlk VERTICAL
  45.     ELSE DO
  46.       MarkBlk
  47.     END
  48.     Move cursorLine cursorColumn
  49.  
  50.     SetDisplayLock OFF
  51.   END
  52.